﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Sicurezza.Client.Controlli
{
    public partial class PasswordForm : Form
    {
        public string Password { get { return passwordBox.Text; } }
        public string Username { get { return usernameBox.Text; } }

        public bool CredentialsMode {

            set {
                if (value)
                {
                    usernameBox.Visible = true;
                    usernameLabel.Visible = true;
                    passwordLabel.Visible = true;
                    Width = 300;
                }
            }
        }

        public string DialogText {
            set {
                label1.Text = value;
                Width = label1.Width + 40;
            }
        }

        public PasswordForm()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }
    }
}
